<include file="__PUBLIC__/_header" />
<body>
<link rel="stylesheet" href="__APP_SKIN__css/newInformation.css?1">
<link rel="stylesheet" href="__APP_SKIN__css/shopCart.css?2">
<link rel="stylesheet" href="__APP_SKIN__css/classification.css">
<link rel="stylesheet" href="__APP_SKIN__css/goodsDetails.css">
<script src="__APP_SKIN__js/cart.js?v=244"></script>
<script src="__APP_SKIN__js/ajax.js?v=207"></script>
<script src="__APP_SKIN__js/index_1.js?44"></script>
<!--头部开始-->
<include file="__PUBLIC__/_nav" />
<!--头部结束-->
<div class="shopInfo">
<style>
table tr th,table tr td{text-align:left}
</style>

   
    <!--<div class="shopInfo-head"></div>-->
    <div class="shopscolldiv">
        <table class="shopcart" border="0" cellspacing="0" cellpadding="0" id="cartTable">
            <thead id="tbody">
			 <tr>
				<th >序号</th>
				<th >条码</th>
				<th>名称</th>
				<th>单位</th>
				<th>整件规格</th>
				<th>配送规格</th>
				<th >零售价</th>
				<th >批发价</th>
				<th colspan="2" >操作</th>
			</tr> 
                <volist name="data" id="vo">
                    <tr id="tr_{$vo.m_id}" class="ck"   data-mprice="{$vo.m_price}"  data-mname="{$vo.m_name}" data-bid="{$vo.b_id}" data-mid="{$vo.m_id}"  data-price="{$vo.price}" >
                        <td class="thd1">
						<input type="checkbox" class="mc" checked value="{$vo.c_id}"/>
						</td>
                        <td >{$vo.c_id}</td>
                        <td>
                            <a href="{:BaseController::_createUrl('index/detail',array('kid'=>$vo['c_id']))}">

                                <div class="shopName">
                                    <div style="padding-left: 2px;border:none;white-space:nowrap;overflow:hidden; text-overflow:ellipsis;" title="{$vo.m_name}">
                                        {$vo.m_name}
                                    </div>
                                </div>
                            </a>
                        </td>
                        <td>{$vo.unit_no}</td>
						<td>{$vo.item_size}</td>
						<td>{$vo.chasedo_spec}</td>
						<td>{$vo.sale_price}</td>
                        <td >{$vo.m_price}</td>                       
                        <td  width="60">
                            <p class="del" onclick="delCollect('{:LoginHelper::getUserId()}','{$vo.c_id}')">取消收藏</p>
							
                        </td>
						<td  width="60">
                           <a href="javascript:void(0)" data-mid="{$vo.c_id}" data-price="{$vo.m_price}" data-chasedo_spec="{$vo.chasedo_spec|round=2}" class="hbtnbuy">立即订购</a>							
                        </td>
                    </tr>
                </volist>
				<tr>
					<td colspan="10" >	
						<p style="float:left"><label>全选</label><input id="all" type="checkbox" checked value="{$vo.c_id}"/></p>
						<p style="float:left;margin-left:20px;"><button type="button" id="batch_pu"  value="全选">批量订购</button></p>										
					</td>
				</tr>
            </thead>
        </table>
    </div>


</div>


<!--2016/9/7 购物车页面,添加促销活动弹窗-->
<!--2016/9/7 购物车页面，背景色-->
<div class="all"></div>
<!--2016/9/7 购物车页面，A组商品+B组商品+C组商品-->
<div class="dialog" style="display: none;overflow: hidden;">
    <iframe src="" width="900" height="580" scrolling="no" frameborder="no" ></iframe>
    <div class="close" onclick="closeDialog()">
        <a>关闭</a>
    </div>
</div>
<input type="hidden" class="address" value="{$users.address}">
<input type="hidden" class="zonge" value="">
<input type="hidden" class="consignee" value="{$users.user_name}">
<input type="hidden" class="tel" value="{$users.mobile}">

<script type="text/javascript">
//    var mySwiper = new Swiper('.swiper-container', {
//        loop: true,
//        grabCursor: true,
//        paginationClickable: false,
//        mode: 'vertical'
//    });
//    $('.arrow-left').on('click', function (e) {
//        e.preventDefault();
//        mySwiper.swipePrev();
//    });
//    $('.arrow-right').on('click', function (e) {
//        e.preventDefault();
//        mySwiper.swipeNext();
//    });
    var site_path = "{$shop_site_path}";
</script>
<div class="footer">
 
</div>
</body>
<script>
    $(function(){
		$("#all").click(function(){   
			if(this.checked){   
				$(".mc").prop("checked", true);  
			}else{   
			$(".mc").prop("checked", false);
			}   
		});
		$("#batch_pu").click(function(){   
			$(".mc").each(function(i,v){
				if($(v).attr("checked") == 'checked'){
					var obj = $(this).parent().parent().find(".hbtnbuy");
					var mid = (obj.attr("data-mid"));
					var price=parseFloat(obj.attr("data-price"));
					var total = obj.attr("data-chasedo_spec");
					addCart(mid,total,price);
				}
			});  
		});
        $('.ck').each(function(){
            var remarke=$(this).find('.remark');
            var remark=remarke.val();
            $(this).attr("data-remark",remark);

        });
        $(".h-confirm").click(function(){
            var ids=[];		var len = 0;
            $('.ck').each(function(){
                var data='';
                data={
                    'm_id':$(this).attr("data-mid"),
                    'total':$(this).attr("data-totalnum"),
                    'm_price':$(this).attr("data-mprice"),
                    "price": $(this).attr("data-price"),
                    'b_id':$(this).attr("data-bid"),
                    'm_group_price':$(this).attr("data-price"),
                    'm_min_price':$(this).attr("data-price"),
                    'm_usual_price':$(this).attr("data-price"),
                    'm_name':$(this).attr("data-mname"),
                    'remark':$(this).attr("data-remark"),
                };
                ids.push(data);
            });
            ids=JSON.stringify(ids);
//            var deliver_time= $("#appDate").val();
           var tel=$(".tel").val(); var zonge=$(".zonge").val();
            var address=$(".address").val(); var consignee=$(".consignee").val();
            var remark=$("#remark").val();

            createOrderHttpHelper.create(ids,'','',address,tel,consignee,zonge,'',remark)
        })
        $(".maintop .left .meun a").eq(4).addClass("active");
		
	   $(".hbtnbuy").click(function(){
            var mid = ($(this).attr("data-mid"));var price=parseFloat($(this).attr("data-price"));
            var total = $(this).attr("data-chasedo_spec");
            addCart(mid,total,price);

        })
    })
</script>
</html>
